|
charger28 2.2.1
|
API for configuring and manipulating Charger 28 Click driver. More...
Topics | |
| Charger 28 Registers List | |
| List of registers of Charger 28 Click driver. | |
| Charger 28 Registers Settings | |
| Settings for registers of Charger 28 Click driver. | |
| Charger 28 MikroBUS Map | |
| MikroBUS pin mapping of Charger 28 Click driver. | |
Functions | |
| void | charger28_cfg_setup (charger28_cfg_t *cfg) |
| Charger 28 configuration object setup function. | |
| err_t | charger28_init (charger28_t *ctx, charger28_cfg_t *cfg) |
| Charger 28 initialization function. | |
| err_t | charger28_default_cfg (charger28_t *ctx) |
| Charger 28 default configuration function. | |
| err_t | charger28_write_reg_bytes (charger28_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| Charger 28 write multiple register bytes function. | |
| err_t | charger28_read_reg_bytes (charger28_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| Charger 28 read multiple register bytes function. | |
| err_t | charger28_write_reg_byte (charger28_t *ctx, uint8_t reg, uint8_t data_in) |
| Charger 28 write single register byte function. | |
| err_t | charger28_read_reg_byte (charger28_t *ctx, uint8_t reg, uint8_t *data_out) |
| Charger 28 read single register byte function. | |
| err_t | charger28_write_reg_word (charger28_t *ctx, uint8_t reg, uint16_t data_in) |
| Charger 28 write register word function. | |
| err_t | charger28_read_reg_word (charger28_t *ctx, uint8_t reg, uint16_t *data_out) |
| Charger 28 read register word function. | |
| err_t | charger28_check_communication (charger28_t *ctx) |
| Charger 28 check communication function. | |
| void | charger28_enable_charging (charger28_t *ctx) |
| Charger 28 enable charging function. | |
| void | charger28_disable_charging (charger28_t *ctx) |
| Charger 28 disable charging function. | |
| uint8_t | charger28_get_pg_pin (charger28_t *ctx) |
| Charger 28 get PG pin state function. | |
| uint8_t | charger28_get_sts_pin (charger28_t *ctx) |
| Charger 28 get STS pin state function. | |
| uint8_t | charger28_get_int_pin (charger28_t *ctx) |
| Charger 28 get INT pin state function. | |
| err_t | charger28_get_ibus (charger28_t *ctx, float *ibus) |
| Charger 28 get input current function. | |
| err_t | charger28_get_ibat (charger28_t *ctx, int16_t *ibat) |
| Charger 28 get battery current function. | |
| err_t | charger28_get_vbus (charger28_t *ctx, uint16_t *vbus) |
| Charger 28 get bus voltage function. | |
| err_t | charger28_get_vpmid (charger28_t *ctx, uint16_t *vpmid) |
| Charger 28 get PMID voltage function. | |
| err_t | charger28_get_vbat (charger28_t *ctx, float *vbat) |
| Charger 28 get battery voltage function. | |
| err_t | charger28_get_vsys (charger28_t *ctx, float *vsys) |
| Charger 28 get system voltage function. | |
| err_t | charger28_get_ts (charger28_t *ctx, float *ts) |
| Charger 28 get TS percentage function. | |
| err_t | charger28_get_tdie (charger28_t *ctx, float *tdie) |
| Charger 28 get die temperature function. | |
| err_t | charger28_get_adcin (charger28_t *ctx, float *adcin) |
| Charger 28 get ADC input function. | |
API for configuring and manipulating Charger 28 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void charger28_cfg_setup | ( | charger28_cfg_t * | cfg | ) |
Charger 28 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See charger28_cfg_t object definition for detailed explanation. |
| err_t charger28_check_communication | ( | charger28_t * | ctx | ) |
Charger 28 check communication function.
This function checks the communication with the device by verifying the part information.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t charger28_default_cfg | ( | charger28_t * | ctx | ) |
Charger 28 default configuration function.
This function executes a default configuration of Charger 28 Click board.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void charger28_disable_charging | ( | charger28_t * | ctx | ) |
Charger 28 disable charging function.
This function disables the charging process by setting the CEN pin high.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| void charger28_enable_charging | ( | charger28_t * | ctx | ) |
Charger 28 enable charging function.
This function enables the charging process by setting the CEN pin low.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| err_t charger28_get_adcin | ( | charger28_t * | ctx, |
| float * | adcin ) |
Charger 28 get ADC input function.
This function reads and calculates the ADC input voltage in millivolts.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | adcin | : Pointer to the variable for storing the calculated ADC input voltage in millivolts. |
0 - Success, -1 - Error. | err_t charger28_get_ibat | ( | charger28_t * | ctx, |
| int16_t * | ibat ) |
Charger 28 get battery current function.
This function reads and calculates the battery current in milliamperes.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | ibat | : Pointer to the variable for storing the calculated battery current in milliamperes. |
0 - Success, -1 - Error. | err_t charger28_get_ibus | ( | charger28_t * | ctx, |
| float * | ibus ) |
Charger 28 get input current function.
This function reads and calculates the input current in milliamperes.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | ibus | : Pointer to the variable for storing the calculated input current in milliamperes. |
0 - Success, -1 - Error. | uint8_t charger28_get_int_pin | ( | charger28_t * | ctx | ) |
Charger 28 get INT pin state function.
This function returns the logic state of the INT (Interrupt) pin.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| uint8_t charger28_get_pg_pin | ( | charger28_t * | ctx | ) |
Charger 28 get PG pin state function.
This function returns the logic state of the PG (Power Good) pin.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| uint8_t charger28_get_sts_pin | ( | charger28_t * | ctx | ) |
Charger 28 get STS pin state function.
This function returns the logic state of the STS (Status) pin.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| err_t charger28_get_tdie | ( | charger28_t * | ctx, |
| float * | tdie ) |
Charger 28 get die temperature function.
This function reads and calculates the die temperature in degrees Celsius.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | tdie | : Pointer to the variable for storing the calculated die temperature in degrees Celsius. |
0 - Success, -1 - Error. | err_t charger28_get_ts | ( | charger28_t * | ctx, |
| float * | ts ) |
Charger 28 get TS percentage function.
This function reads and calculates the TS percentage of REGN.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | ts | : Pointer to the variable for storing the calculated TS percentage. |
0 - Success, -1 - Error. | err_t charger28_get_vbat | ( | charger28_t * | ctx, |
| float * | vbat ) |
Charger 28 get battery voltage function.
This function reads and calculates the battery voltage in millivolts.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | vbat | : Pointer to the variable for storing the calculated battery voltage in millivolts. |
0 - Success, -1 - Error. | err_t charger28_get_vbus | ( | charger28_t * | ctx, |
| uint16_t * | vbus ) |
Charger 28 get bus voltage function.
This function reads and calculates the bus voltage in millivolts.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | vbus | : Pointer to the variable for storing the calculated bus voltage in millivolts. |
0 - Success, -1 - Error. | err_t charger28_get_vpmid | ( | charger28_t * | ctx, |
| uint16_t * | vpmid ) |
Charger 28 get PMID voltage function.
This function reads and calculates the PMID voltage in millivolts.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | vpmid | : Pointer to the variable for storing the calculated PMID voltage in millivolts. |
0 - Success, -1 - Error. | err_t charger28_get_vsys | ( | charger28_t * | ctx, |
| float * | vsys ) |
Charger 28 get system voltage function.
This function reads and calculates the system voltage in millivolts.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [out] | vsys | : Pointer to the variable for storing the calculated system voltage in millivolts. |
0 - Success, -1 - Error. | err_t charger28_init | ( | charger28_t * | ctx, |
| charger28_cfg_t * | cfg ) |
Charger 28 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See charger28_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t charger28_read_reg_byte | ( | charger28_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
Charger 28 read single register byte function.
This function reads a single byte from a specific register.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to the data buffer for storing the read value. |
0 - Success, -1 - Error. | err_t charger28_read_reg_bytes | ( | charger28_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
Charger 28 read multiple register bytes function.
This function reads multiple bytes from a specific register.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to the data buffer for storing read values. |
| [in] | len | : Number of bytes to read. |
0 - Success, -1 - Error. | err_t charger28_read_reg_word | ( | charger28_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t * | data_out ) |
Charger 28 read register word function.
This function reads a 16-bit word from a specific register.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to the 16-bit word buffer for storing the read value. |
0 - Success, -1 - Error. | err_t charger28_write_reg_byte | ( | charger28_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
Charger 28 write single register byte function.
This function writes a single byte to a specific register.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data byte to write. |
0 - Success, -1 - Error. | err_t charger28_write_reg_bytes | ( | charger28_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
Charger 28 write multiple register bytes function.
This function writes multiple bytes to a specific register.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Pointer to the data to write. |
| [in] | len | : Number of bytes to write. |
0 - Success, -1 - Error. | err_t charger28_write_reg_word | ( | charger28_t * | ctx, |
| uint8_t | reg, | ||
| uint16_t | data_in ) |
Charger 28 write register word function.
This function writes a 16-bit word to a specific register.
| [in] | ctx | : Click context object. See charger28_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : 16-bit word to write. |
0 - Success, -1 - Error.